package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:53:53
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelBaseBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelBaseDAO.Id);

        mappedDaoFields.put("modelBaseName",
            com.ourteam.product.model.dao.IProductModelBaseDAO.ModelBaseName);

        mappedDaoFields.put("modelBaseType",
            com.ourteam.product.model.dao.IProductModelBaseDAO.ModelBaseType);

        mappedDaoFields.put("creatorName",
            com.ourteam.product.model.dao.IProductModelBaseDAO.CreatorName);

        mappedDaoFields.put("createTime",
            com.ourteam.product.model.dao.IProductModelBaseDAO.CreateTime);

        mappedDaoFields.put("lastModifierName",
            com.ourteam.product.model.dao.IProductModelBaseDAO.LastModifierName);

        mappedDaoFields.put("lastModifyTime",
            com.ourteam.product.model.dao.IProductModelBaseDAO.LastModifyTime);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelBaseDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelBaseDAO.Remarks);

        mappedDaoFields.put("ownerId",
            com.ourteam.product.model.dao.IProductModelBaseDAO.OwnerId);
    }

    private com.ourteam.product.model.dao.ProductModelBase productModelBase;

    public ProductModelBaseBean() {
        super();

        this.productModelBase = new com.ourteam.product.model.dao.ProductModelBase();
    }

    public ProductModelBaseBean(
        com.ourteam.product.model.dao.ProductModelBase productModelBase) {
        super();

        this.productModelBase = productModelBase;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelBase);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelBase convertToProductModelBase() {
        return this.productModelBase;
    }

    public com.ourteam.product.model.dao.ProductModelBase convertTo() {
        return this.productModelBase;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelBase.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelBase.setId(id);
    }

    /**
     * Get modelBaseName
     *
     * @return String
     */
    public String getModelBaseName() {
        return (String) this.productModelBase.getModelBaseName();
    }

    /**
     * Set modelBaseName
     *
     * @parameter String
     */
    public void setModelBaseName(String modelBaseName) {
        this.productModelBase.setModelBaseName(modelBaseName);
    }

    /**
     * Get modelBaseType
     *
     * @return String
     */
    public String getModelBaseType() {
        return (String) this.productModelBase.getModelBaseType();
    }

    /**
     * Set modelBaseType
     *
     * @parameter String
     */
    public void setModelBaseType(String modelBaseType) {
        this.productModelBase.setModelBaseType(modelBaseType);
    }

    /**
     * Get creatorName
     *
     * @return String
     */
    public String getCreatorName() {
        return (String) this.productModelBase.getCreatorName();
    }

    /**
     * Set creatorName
     *
     * @parameter String
     */
    public void setCreatorName(String creatorName) {
        this.productModelBase.setCreatorName(creatorName);
    }

    /**
     * Get createTime
     *
     * @return java.util.Date
     */
    public java.util.Date getCreateTime() {
        return (java.util.Date) this.productModelBase.getCreateTime();
    }

    /**
     * Set createTime
     *
     * @parameter java.util.Date
     */
    public void setCreateTime(java.util.Date createTime) {
        this.productModelBase.setCreateTime(createTime);
    }

    /**
     * Get lastModifierName
     *
     * @return String
     */
    public String getLastModifierName() {
        return (String) this.productModelBase.getLastModifierName();
    }

    /**
     * Set lastModifierName
     *
     * @parameter String
     */
    public void setLastModifierName(String lastModifierName) {
        this.productModelBase.setLastModifierName(lastModifierName);
    }

    /**
     * Get lastModifyTime
     *
     * @return java.util.Date
     */
    public java.util.Date getLastModifyTime() {
        return (java.util.Date) this.productModelBase.getLastModifyTime();
    }

    /**
     * Set lastModifyTime
     *
     * @parameter java.util.Date
     */
    public void setLastModifyTime(java.util.Date lastModifyTime) {
        this.productModelBase.setLastModifyTime(lastModifyTime);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelBase.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelBase.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelBase.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelBase.setRemarks(remarks);
    }

    /**
     * Get ownerId
     *
     * @return long
     */
    public long getOwnerId() {
        return (long) this.productModelBase.getOwnerId();
    }

    /**
     * Set ownerId
     *
     * @parameter long
     */
    public void setOwnerId(long ownerId) {
        this.productModelBase.setOwnerId(ownerId);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelBaseBean) == false) {
            return false;
        } // end if

        ProductModelBaseBean other = (ProductModelBaseBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelBase tempProductModelBase = other.convertToProductModelBase();

        if ((tempProductModelBase == null) || (this.productModelBase == null)) {
            isEqual = false;
        } else if ((tempProductModelBase == this.productModelBase) ||
                tempProductModelBase.equals(this.productModelBase)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelBaseBean[] toArray(
        com.ourteam.product.model.dao.ProductModelBase[] aProductModelBases) {
        return toArray(aProductModelBases, null);
    }

    public static ProductModelBaseBean[] toArray(
        com.ourteam.product.model.dao.ProductModelBase[] aProductModelBases,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelBases)) {
            return new ProductModelBaseBean[0];
        }

        int length = aProductModelBases.length;

        ProductModelBaseBean[] beans = new ProductModelBaseBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelBaseBean(aProductModelBases[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelBases[i] });
            }
        }

        return beans;
    }
}
